package spil;

import java.awt.Color;

import boundaryToMatador.Car;
import boundaryToMatador.Field;

public interface iAdapter {

	public abstract void create(String path);

	public abstract void create(Field[] fields);

	/**
	 * Closes the GUI, so you can start a new one. After this it is possible to
	 * call create(path)
	 */
	public abstract void close();

	/**
	 * Displays a message to the user.<br>
	 * @param msg The message to print.
	 */
	public abstract void showMessage(String msg);

	/**
	 * Displays a message to the user and awaits the response.<br>
	 * @param msg The message that promts the user.
	 * @return The string that the user has entered.
	 */
	public abstract String getUserString(String msg);

	/**
	 * Displays a message to the user and awaits the integer response. Only
	 * values between min and max are allowed.<br>
	 * @param msg The message that promts the user.
	 * @param min The minimum value the user is allowed to enter.
	 * @param max The maximum value the user is allowed to enter.
	 * @return The integer that the user selected.
	 */
	public abstract int getUserInteger(String msg, int min, int max);

	/**
	 * Displays a message to the user and awaits the integer response.<br>
	 * @param msg The message that promts the user.
	 * @return The integer that the user selected.
	 */
	public abstract int getUserInteger(String msg);

	/**
	 * Displays a message to the user and awaits the button pressed response.<br>
	 * @param msg The message that promts the user.
	 * @param buttons A number of strings that should be printed on the buttons
	 *        the user can press.
	 * @return The string from the button that the user pressed.
	 */
	public abstract String getUserButtonPressed(String msg, String... buttons);

	/**
	 * Displays a message to the user and awaits the drop-down response.<br>
	 * @param msg The message that promts the user.
	 * @param options A number of strings with the texts that the user should
	 *        choose from.
	 * @return The string that the user selected.
	 */
	public abstract String getUserSelection(String msg, String... options);

	/**
	 * Displays a message to the user and awaits the boolean response.<br>
	 * @param msg The message that promts the user.
	 * @param trueButton The text that should appear on the left button.
	 * @param falseButton The text that should appear on the right button.
	 * @return True if the left button is pressed by the user. False otherwise.
	 */
	public abstract boolean getUserLeftButtonPressed(String msg,
			String trueButton, String falseButton);

	/**
	 * Sets the title of a field on the board.<br>
	 * @param fieldNumber : int [1:40]
	 * @param title : String (Mind the length!)
	 */
	public abstract void setTitleText(int fieldNumber, String title);

	/**
	 * Sets the subText of a field on the board.<br>
	 * @param fieldNumber : int [1:40]
	 * @param subText : String (Mind the length!)
	 */
	public abstract void setSubText(int fieldNumber, String subText);

	/**
	 * Sets the Description (The text shown in the center when mouse hovers) of
	 * a field on the board.<br>
	 * @param fieldNumber : int [1:40]
	 * @param description : String (Mind the length!)
	 */
	public abstract void setDescriptionText(int fieldNumber, String description);

	/**
	 * Adds a player to the board.<br>
	 * Max. 6 players.<br>
	 * @param name : String (Mind the length!) (Unique identifier of the player
	 *        - no duplicates)
	 * @param balance : int
	 * @param r The RED part of the player color
	 * @param g The GREEN part of the player color
	 * @param b The BLUE part of the player color
	 */
	public abstract void addPlayer(String name, int balance, int r, int g, int b);

	/**
	 * Adds a player to the board.<br>
	 * Max. 6 players.<br>
	 * @param name : String (Mind the length!) (Unique identifier of the player
	 *        - no duplicates)
	 * @param balance : int
	 * @param color : Color
	 */
	public abstract void addPlayer(String name, int balance, Color color);

	public abstract void addPlayer(String name, int balance, Car car);

	/**
	 * @param name : String (Mind the length!) (Unique identifier of the player
	 *        - no duplicates)
	 * @param balance : int Player = 1 : RED Player = 2 : BLUE Player = 3 :
	 *        GREEN Player = 4 : YELLOW Player = 5 : BLACK Player = 6 : WHITE
	 */
	public abstract void addPlayer(String name, int balance);

	/**
	 * Sets the balance of a player if the player has been added.
	 * @param name The name of the player
	 * @param newBalance : int
	 */
	public abstract void setBalance(String name, int newBalance);

	/**
	 * Shows two dice on the board. The dice will have the specified values, but
	 * the placement is random.<br>
	 * @param faceValue1 : int [1:6]
	 * @param rotation1 : int [0:360]
	 * @param faceValue2 : int [1:6]
	 * @param rotation2 : int [0:360[
	 * @param x1 : int [0:11]
	 * @param y1 : int [0:11]
	 * @param x2 : int [0:11]
	 * @param y2 : int [0:11]<br>
	 *        (If a parameter is out of bounds nothing will happen!)
	 */
	public abstract void setDice(int faceValue1, int rotation1, int x1, int y1,
			int faceValue2, int rotation2, int x2, int y2);

	/**
	 * Shows two dice on the board. The dice will have the specified values, but
	 * the placement is random.<br>
	 * @param faceValue1 : int [1:6]
	 * @param faceValue2 : int [1:6]
	 * @param x1 : int [0:11]
	 * @param y1 : int [0:11]
	 * @param x2 : int [0:11]
	 * @param y2 : int [0:11]<br>
	 *        (If a parameter is out of bounds nothing will happen!)
	 */
	public abstract void setDice(int faceValue1, int x1, int y1,
			int faceValue2, int x2, int y2);

	/**
	 * Shows two dice on the board. The dice will have the specified values, but
	 * the placement is random.<br>
	 * @param faceValue1 : int [1:6]
	 * @param rotation1 : int [0:360]
	 * @param faceValue2 : int [1:6]
	 * @param rotation2 : int [0:360[<br>
	 *        (If a parameter is out of bounds nothing will happen!)
	 */
	public abstract void setDice(int faceValue1, int rotation1, int faceValue2,
			int rotation2);

	/**
	 * Shows two dice on the board. The dice will have the specified values, but
	 * the placement is random.<br>
	 * @param faceValue1 : int [1:6]
	 * @param faceValue2 : int [1:6]<br>
	 *        (If a parameter is out of bounds nothing will happen!) Uses random
	 *        rotation.
	 */
	public abstract void setDice(int faceValue1, int faceValue2);

	/**
	 * Sets the next text that will appear in the center when a player lands on
	 * a chance field or when the deck is pressed. This should be done before
	 * the player lands on a chance field.
	 * @param txt : String (Mind the length!)<br>
	 */
	public abstract void setNextChanceCardText(String txt);

	/**
	 * Places a car on the field.<br>
	 * All cars can be placed on the same field.<br>
	 * A car can only be placed if the corresponding player has been added.<br>
	 * If a car is placed on the same field multiple times, nothing more
	 * happens.<br>
	 * A car can not be placed on multiple fields simultaneously.
	 * @param fieldNumber : int [1:40]
	 * @param name The name of the player
	 */
	public abstract void setCar(int fieldNumber, String name);

	/**
	 * Removes a car from the board.<br>
	 * If the car is not on the board, nothing happens.
	 * @param fieldNumber : int [1:40]
	 * @param name The name of the player
	 */
	public abstract void removeCar(int fieldNumber, String name);

	/**
	 * Removes all cars belonging to this player.
	 * @param name The name of the player.
	 */
	public abstract void removeAllCars(String name);

	/**
	 * Sets an owner of a field.<br>
	 * The field border will have the same color as the player. The owners name
	 * will be printed in the subText. If the field is not a street, shipping or
	 * a brewery nothing happens.<br>
	 * If the owner hasn't been added to the board, nothing happens.
	 * @param fieldNumber : int [1:40]
	 * @param name The name of the player
	 */
	public abstract void setOwner(int fieldNumber, String name);

	/**
	 * Removes an owner from the field.<br>
	 * If the field has no owner, nothing happens.
	 * @param fieldNumber : int [1:40]
	 */
	public abstract void removeOwner(int fieldNumber);

	/**
	 * Sets houses from the street, and removes the hotel if one is present.<br>
	 * If houseCount is out of bounds, nothing happens.<br>
	 * If field is not a street, nothing happens.<br>
	 * @param fieldNumber : int [1:40]
	 * @param houseCount : int [0:4]
	 */
	public abstract void setHouses(int fieldNumber, int houseCount);

	/**
	 * Sets whether or not a hotel should be on the street and removes all
	 * houses if any is present.<br>
	 * @param fieldNumber : int [1:40]
	 * @param hasHotel : boolean
	 */
	public abstract void setHotel(int fieldNumber, boolean hasHotel);

}